<?php /* SVN: $Id: $ */ ?>
<div class="projectFollowers index js-response">
<div class="page-count-block clearfix">
	    <div class="grid_left">
	      <?php echo $this->element('paging_counter'); ?>
		</div>
		<div class="grid_left">
            <?php echo $this->Form->create('ProjectFollower', array('type' => 'get', 'class' => 'normal search-form clearfix', 'action'=>'index')); ?>
            		<?php echo $this->Form->input('q', array('label' => __l('Keyword'))); ?>
            		<?php echo $this->Form->submit(__l('Search'));?>
            <?php echo $this->Form->end(); ?>
		</div>
  </div>
<?php echo $this->Form->create('ProjectFollower' , array('class' => 'normal clearfix','action' => 'update')); ?>
    <?php echo $this->Form->input('r', array('type' => 'hidden', 'value' => $this->request->url)); ?>
<table class="list">
    <tr>
	    <?php if(empty($this->request->params['named']['view_type'])) :?>
        <th class="select"><?php echo __l('Select'); ?></th>
        <?php endif; ?>
      	<th class="actions"><?php echo __l('Actions'); ?></th>
        <th class="dl"><div class="js-pagination"><?php echo $this->Paginator->sort(__l('Project'),'Project.name');?></div></th>
        <th><div class="js-pagination"><?php echo $this->Paginator->sort(__l('User'),'User.username');?></div></th>
        <th><div class="js-pagination"><?php echo $this->Paginator->sort(__l('Created'),'created');?></div></th>
    </tr>
<?php
if (!empty($projectFollowers)):

$i = 0;
foreach ($projectFollowers as $projectFollower):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}

?>
	<tr<?php echo $class;?>>
		<?php if(empty($this->request->params['named']['view_type'])) :?>
     	<td class="select"><?php echo $this->Form->input('ProjectFollower.'.$projectFollower['ProjectFollower']['id'].'.id', array('type' => 'checkbox', 'id' => "admin_checkbox_".$projectFollower['ProjectFollower']['id'], 'label' => false, 'class' =>' js-checkbox-list')); ?></td>
        <?php endif; ?>
		<td class="actions dl">
            <div class="action-block">
                <span class="action-information-block">
                    <span class="action-left-block">&nbsp;&nbsp;</span>
                        <span class="action-center-block">
                            <span class="action-info">
                                <?php echo __l('Action');?>
                             </span>
                        </span>
                    </span>
                    <div class="action-inner-block">
                    <div class="action-inner-left-block">
                        <ul class="action-link clearfix">
		<li><?php echo $this->Html->link(__l('Delete'), array('action'=>'delete', $projectFollower['ProjectFollower']['id']), array('class' => 'delete js-delete', 'title' => __l('Delete')));?></li>
                        		 </ul>
    					</div>
    					<div class="action-bottom-block"></div>
    				  </div>
              </div>
        </td>
		<td class="dl">
              <div class="clearfix">
              <?PHP
                         if($is_wallet_enabled)
                         {
                            $project_status = $projectFollower['Project']['ProjectStatus']['name'];
                         }
                           else
                           {
                             $project_status = str_replace("Refunded","Voided",$projectFollower['Project']['ProjectStatus']['name']);
                           }
                        ?>
                 <span title="<?php echo $this->Html->cText($project_status,false); ?>" class="project-atatus-info project-status-<?php echo $projectFollower['Project']['project_status_id'];?>">
                 <?php echo $this->Html->cText($project_status); ?>
                 </span>
		<?php echo $this->Html->link($this->Html->cText($this->Html->truncate($projectFollower['Project']['name'],90, array('ending' => '...'))), array('controller'=> 'projects', 'action'=>'view', $projectFollower['Project']['slug'],'admin' => false), array('escape' => false,'title'=>$this->Html->cText($projectFollower['Project']['name'],false)));?>                 
                </div>         
        </td>
		<td> <?php echo $this->Html->link($this->Html->cText($projectFollower['User']['username'],false), array('controller'=> 'users', 'action'=>'view', $projectFollower['User']['username'],'admin' => false), array('escape' => false,'title'=>$this->Html->cText($projectFollower['User']['username'],false)));?></td>
   		<td><?php echo $this->Html->cDateTimeHighlight($projectFollower['ProjectFollower']['created']);?></td>

	</tr>
<?php
    endforeach;
else:
?>
	<tr>
		<td colspan="6" class="notice"><?php echo __l('No Project Followers available');?></td>
	</tr>
<?php
endif;
?>
</table>

<?php
if (!empty($projectFollowers)) : ?>
        <div class="clearfix">
    <?php if(empty($this->request->params['named']['view_type'])) :?>
	<div class="admin-select-block grid_left">
            <?php echo __l('Select:'); ?>
            <?php echo $this->Html->link(__l('All'), '#', array('class' => 'js-admin-select-all','title' => __l('All'))); ?>
            <?php echo $this->Html->link(__l('None'), '#', array('class' => 'js-admin-select-none','title' => __l('None'))); ?>
        </div>
        	<div class="admin-checkbox-button grid_4 grid_left">
            <?php echo $this->Form->input('more_action_id', array('class' => 'js-admin-index-autosubmit', 'options'=>$moreActions,'label' => false, 'empty' => __l('-- More actions --'))); ?>
        </div>
         <?php endif; ?>
  <div class="js-pagination grid_right">
           <?php  echo $this->element('paging_links'); ?>
    </div>
           </div>
<?php  endif; 

  echo $this->Form->end();
?>
</div>
